﻿using System.Collections.Generic;
using System.Linq;

namespace LuatChoi
{
    public class Vua : QuanCo
    {
        public Vua()
        {
        }

        public Vua(Phe mau, BanCo banCo, int x, int y)
        {
            ToaDo = new Vector(x, y);
            Ban = banCo;
            Mau = mau;
        }

        public override void TinhToaDoAnhHuong()
        {
            ToaDoCoTheDiChuyen = new List<Vector>();
            ToaDoCoTheTanCong = new List<Vector>();

            CheoLenPhai(1);
            CheoLenTrai(1);
            CheoXuongPhai(1);
            CheoXuongTrai(1);
            DiLen(1);
            DiXuong(1);
            DiTrai(1);
            DiPhai(1);

            ToaDoCoTheTanCong = (from vector in ToaDoCoTheTanCong
                                 where !(Ban[vector.X, vector.Y] is Vua)
                                 select vector).ToList();
        }
    }
}